<template>
	<view>
		<!-- 组件及组件通信 -->
		<!-- 父组件向子组件通信 -->
		<module1 :url="url1" @urlPrint="printUrl"></module1>
		<module1 :url="url2" @urlPrint="printUrl"></module1>
		<view class="" style="overflow: auto;">
			来自子组件的信息: {{url}}
		</view>
		
	</view>
</template>

<script>
	
	import module1 from '../../components/module1.vue'
	
	export default {
		data() {
			return {
				url: '',
				url1: "http://119.29.67.157:8080/xiaohong/M00/00/00/CgAICGBNguuABspBAAAh_1w3BhI837.jpg",
				url2:"http://119.29.67.157:8080/xiaohong/M00/00/00/CgAICGBNgzWAVyp6AAAS9YDVPuk476.jpg",
			}
		},
		onLoad() {
			console.log('打印全局变量')
			console.log(this.baseurl)
			this.baseurl = "baidu"
			console.log(this.baseurl)
			console.log(getApp().globalData.base)
			getApp().globalData.base = 123
			console.log(getApp().globalData.base)
			console.log('打印全局方法')
			console.log(this.add(1))
		},
		methods: {
			printUrl(e) {
				this.url = e 
			}
		},
		components: {
			module1
		}
	}
</script>

<style>

</style>
